package com.hgx.db;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

/**
 * 
 * 数据库基本操作
 * 
 * @time 2017-1-4
 * 
 * @author Administrator
 * 
 */
public class DbBase {

	public boolean executeUpdate(String sqlstr) {
		boolean flag = false;
		if (null == sqlstr) {
			return flag;
		}

		Connection conn = HC3P0ConnentionProvider.getConnection();
		try {
			PreparedStatement ps = conn.prepareStatement(sqlstr);
			int num = ps.executeUpdate();
			flag = num > 0;
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return flag;
	}

}
